#include <common.h>

class Solution {
public:
    int hIndex(vector<int>& citations) {
        int n = citations.size();
        auto is_h=[&citations](int h)->bool{
            int cnt = 0;
            for(auto x:citations){
                if(x>=h)cnt++;
            }
            return cnt>=h;
        };
        for(int i=n;i>0;i--){
            if(is_h(i))return i;
        }
        return 0;
    }
};

int main() {

    return 0;
}